// 传统定义方法
let square = {
  area: function () {
    return this.side * this.side;
  },
  side: 10,
};
console.log(square.area()); // 100

// ES6 之后定义方法
let square2 = {
  area() {
    return this.side * this.side;
  },
  side: 11,
};
console.log(square2.area()); // 121
